<script type="text/javascript">

function TreeNode(x) {
    this.val = x;
    this.left = null;
    this.right = null;
}
let a = new TreeNode(1);
let b = new TreeNode(2);
let c = new TreeNode(3);
let d = new TreeNode(4);
let e = new TreeNode(5);
let f = new TreeNode(6);
let g = new TreeNode(7);
a.left = b;
a.right = c;
b.left = d;
b.right = e;
c.left = f;
	
function TreeDeep(root) {
	if(!root) {
		return 0;
	}
	let left = 1, right = 1;
	left += TreeDeep(root.left);
	right += TreeDeep(root.right);
	return Math.max(left, right)
} 

const res = TreeDeep(a);
console.log(res)

</script>